#include <my_head.h>
int main(int argc, char const *argv[])
{
    if(3 != argc){
        printf("Usage:%s src_file dest_file\n", argv[0]);
        return -1;
    }
    int fd_r = 0;
    if(-1 == (fd_r = open(argv[1],O_RDONLY)))
        ERR_LOG("open error");
    int fd_w = 0;
    if(-1 == (fd_w = open(argv[2],O_WRONLY|O_CREAT|O_TRUNC,0664)))
        ERR_LOG("open error");
    char buff[20];
    /*read(fd_r,buff,20);   
    write(fd_w,buff,20);*/
    int nbytes = 0;
    while(0<(nbytes = read(fd_r,buff,sizeof(buff)))){
        write(fd_w,buff,nbytes);
    }
    close(fd_r);
    close(fd_w);
    return 0;
}
